﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QLDonDatHang
{
    public partial class Form_Home : Form
    {
        Form fr_QLDondathang,fr_Mathang,fr_login;
        public Form_Home()
        {
            InitializeComponent();
        }

        private void Form_Home_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (Checkform("Form_Dondathang"))
                fr_QLDondathang.Activate();
            else
            {
                fr_QLDondathang = new Form_Dondathang();
                fr_QLDondathang.MdiParent = this;
                fr_QLDondathang.Show();
            }
        }



        // check form
        public Boolean Checkform(string Frm_Name)
        {
            foreach (Form frm in this.MdiChildren)
            {
                if (frm.Name.Equals(Frm_Name))
                    return true;
            }
            return false;
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

        private void bt_DangXuat_Click(object sender, EventArgs e)
        {
            this.Close();
            this.Dispose();
            fr_login = new Form_Login2();
            fr_login.Show();
        }

        private void bt_ThongTin_Click(object sender, EventArgs e)
        {

        }

        private void bt_MatHang_Click(object sender, EventArgs e)
        {
            fr_Mathang = new Form_MatHang();
            fr_Mathang.Show(); 
        }

        private void BT_KhoHang_Click(object sender, EventArgs e)
        {

        }

        private void bt_ThuChi_Click(object sender, EventArgs e)
        {

        }

        private void bt_DonDatHang_Click(object sender, EventArgs e)
        {
            
        }
    }
}
